<template>
    <div>
        <h2>我是弟弟，我开的我哥的{{car}}车</h2>
    </div>
</template>


<script>
import PubSub from "pubsub-js"
export default {
    name:"Didi",
    data(){
        return {
            car:"八手奥迪",
        }
    },
    mounted(){
        PubSub.subscribe("getCar",this.getCar);
    },
    methods:{
        getCar(_,value){
            this.car=value;
        }
    }
}
</script>